package com.test.ssm.controller;

import com.test.ssm.pojo.Menu;
import com.test.ssm.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class SystemController {
    @Autowired
    private MenuService menuService;

    @RequestMapping("index.html")
    public String index() {
        return "WEB-INF/pages/index.jsp";
    }

    @RequestMapping("side.html")
    @ResponseBody
    public List<Menu> getMenuTree() {
        return menuService.getMenuTree();
    }
}
